export default {
    namespaced: true,
    state: {
        isShowToast: false,
        toastType: '',
        toastMsg: '',
    },
    getters: {},
    mutations: {
        changeIsShowToast(state, payload) {
            state.isShowToast = payload.isShow;
            if (payload.isShow) {
                state.toastType = payload.type;
                state.toastMsg = payload.msg;
            }
        },
    },
    actions: {
        asyncchangeIsShowToast(context, payload) {
            context.commit('changeIsShowToast', {
                isShow: true,
                msg: payload.msg,
                type: payload.type,
            });
            setTimeout(() => {
                context.commit('changeIsShowToast', { isShow: false });
            }, 1500);
        },
    },
};
